

<neos type="view" name="head"/>

<?php
	$id_usuario = $_SESSION['idUsuario'];
	$bd_usuario = _db("SELECT * FROM usuarios WHERE id = '".$id_usuario."'");
	$bd_pessoas = _db("SELECT * FROM pessoas WHERE id = '".$bd_usuario[0]->pessoa_id."'");
	$bd_endereco = _db("SELECT * FROM enderecos WHERE id = '".$bd_pessoas[0]->endereco_id."'");
?>

<div class="pagina">
		<div class="links"><a href="<neos:url/>sair">Logoff</a> | <a href="<neos:url/>CLogin/Redirect">Menu</a></div>
		
		<div class="formulario">
		<form action="<neos:url/>Ceditcadastro/editcadastro" name="frm_cadastro" method="post">
			<h2>Dados Pessoais</h2>
			<label>nome:</label>
			<input name="nome" type="text" id="nome" size="60" maxlength="100" value="<?php echo $bd_pessoas[0]->nome; ?>"/>
			<label>Telefone:</label>
			<input name="telefone" type="text" id="telefone" size="18" maxlength="100" onkeypress="maskIt(this,event,'(##)####-####')" value="<?php echo $bd_pessoas[0]->telefone; ?>"/>
			<label>E-mail:</label>
			<input name="email" type="text" id="email" size="60" maxlength="100" value="<?php echo $bd_pessoas[0]->email; ?>"/>
			
			<h2>Endereco</h2>
			<label>Estado:</label>
			<input name="estado" type="text" id="estado" size="60" maxlength="100" value="<?php echo $bd_endereco[0]->estado; ?>"/>
			<label>Cidade:</label>
			<input name="cidade" type="text" id="cidade" size="60" maxlength="100" value="<?php echo $bd_endereco[0]->cidade; ?>"/>
			<label>Cep:</label>
			<input name="cep" type="text" id="cep" size="60" maxlength="100" onChange="if(!isNumeric(this.value)){alert('Use somente numero'); this.value = null;}" value="<?php echo $bd_endereco[0]->cep; ?>"/>
			<label>Rua:</label>
			<input name="rua" type="text" id="rua" size="60" maxlength="100" value="<?php echo $bd_endereco[0]->rua; ?>"/>
			<label>Bairro:</label>
			<input name="bairro" type="text" id="bairro" size="60" maxlength="100" value="<?php echo $bd_endereco[0]->bairro; ?>"/>
			<label>Numero:</label>
			<input name="numero" type="text" id="numero" size="60" maxlength="100" onChange="if(!isNumeric(this.value)){alert('Use somente numero'); this.value = null;}" value="<?php echo $bd_endereco[0]->numero; ?>"/>		
			<label>Complemento:</label>
			<input name="complemento" type="text" id="complemento" size="60" maxlength="100" value="<?php echo $bd_endereco[0]->complemento; ?>"/>
	
			
			<input type="submit" value="Salvar" />
		</form>
	</div>
	
</div>
<neos type="view" name="footer"/>
